package zsy.test.设计模式.singleton;

/**
 * 静态内部类实现懒汉式单例，线程安全
 *
 * @author zhangshuaiyin
 * @date 2022/8/8 10:37
 */
public class StaticInnerSingleton {

    private StaticInnerSingleton() {
    }

    public static StaticInnerSingleton getInstance() {
        return InnerClass.INSTANCE;
    }

    static class InnerClass {
        private static final StaticInnerSingleton INSTANCE = new StaticInnerSingleton();
    }

}
